﻿
@model ReturnOrderViewModel

<div class="card card-primary">
    <div class="card-header">
        <h3 class="card-title">@ViewBag.Title</h3>
    </div>
    <form asp-action="ReturnOrderEdit" method="post">
        <input type="hidden" asp-for="Id" />

        <div class="card-body">
            <div class="form-group">
                <label asp-for="ItemName"></label>
                <input type="text" class="form-control" asp-for="ItemName">
                <span asp-validation-for="ItemName" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="ItemCode"></label>
                <input type="text" class="form-control" asp-for="ItemCode">
                <span asp-validation-for="ItemCode" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Remark"></label>
                <input type="text" class="form-control" asp-for="Remark">
            </div>
            <div class="form-group">
                <label>采购单</label>
                <div class="input-group mb-2">
                    <select asp-for="PurchaseOrderId"
                            class="form-control select2"
                            style="width: 100%;"
                            onchange="FunSelectItem(this)"
                            asp-items="@Model.PurchaseOrderList">
                        <option>==请选择==</option>
                    </select>
                </div>
                @if (Model?.PurchaseOrderList != null)
                {
                    <table class="table table-hover text-nowrap table-bordered">
                        <thead class="thead-light">
                            <tr>
                                <th>采购单号</th>
                                <th>物料编码</th>
                                <th>物料名称</th>
                                <th>审核人</th>
                                <th>审核时间</th>
                                <th>审核状态</th>
                                <th>采购总数</th>
                                <th>采购类型</th>
                                <th>创建人</th>
                                <th>创建时间</th>
                                <th>产地</th>
                                <th>备注</th>
                            </tr>
                        </thead>
                        <tbody class="tbody"></tbody>
                    </table>
                }
            </div>
        </div>
        <div class="card-footer">
            <button type="submit" class="btn btn-primary">提交</button>
            <a class="btn btn-info" asp-action="Index">返回 </a>
        </div>
    </form>
</div>

@section ReturnOrderEditJsFile{
    <script src="~/js/ReturnOrderEdit.js" asp-append-version="true"></script>
}

<script>
    window.onload = function () {
    var id = @Model.PurchaseOrderId;
    if (id == 0 || id == undefined) return;
    AjaxRequest(id);
}
</script>